package cn.richx.pushmessage.repository;

import cn.richx.pushmessage.domain.PushMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * Spring Data JPA repository for the PushMessage entity.
 */
@SuppressWarnings("unused")
@Repository
public interface PushMessageRepository extends JpaRepository<PushMessage, Long> {

    Long countByStatus(Integer status);

    @Query("select push from PushMessage push where push.pushId > ?1 and push.receiverId = ?2")
    List<PushMessage> getNoReadList(Long id, String userId);
}
